package com.lpit.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 广告数据表
 * @TableName advertising_data
 */
@TableName(value ="advertising_data")
@Data
public class AdvertisingData implements Serializable {
    /**
     * 广告数据表id
     */
    @TableId
    private Integer id;

    /**
     * 广告投放的文章id
     */
    private Integer articleId;

    /**
     * 广告id
     */
    private Integer advertisingId;

    /**
     * 广告展示量
     */
    private Integer impressions;

    /**
     * 广告点击量
     */
    private Integer clicks;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AdvertisingData other = (AdvertisingData) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getArticleId() == null ? other.getArticleId() == null : this.getArticleId().equals(other.getArticleId()))
            && (this.getAdvertisingId() == null ? other.getAdvertisingId() == null : this.getAdvertisingId().equals(other.getAdvertisingId()))
            && (this.getImpressions() == null ? other.getImpressions() == null : this.getImpressions().equals(other.getImpressions()))
            && (this.getClicks() == null ? other.getClicks() == null : this.getClicks().equals(other.getClicks()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getArticleId() == null) ? 0 : getArticleId().hashCode());
        result = prime * result + ((getAdvertisingId() == null) ? 0 : getAdvertisingId().hashCode());
        result = prime * result + ((getImpressions() == null) ? 0 : getImpressions().hashCode());
        result = prime * result + ((getClicks() == null) ? 0 : getClicks().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", articleId=").append(articleId);
        sb.append(", advertisingId=").append(advertisingId);
        sb.append(", impressions=").append(impressions);
        sb.append(", clicks=").append(clicks);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}